//类装饰器
function sealed(constructor:Function){
    Object.seal(constructor);
    Object.seal(constructor.prototype);
}

@sealed
class Greeter{
   public greeting:string;
   constructor(message:string){
       this.greeting=message;
   }
   greeter(){
       return "Hello, "+this.greeting;
   }
}

//方法装饰器
function enumerable(value: boolean) {
    return function (target: any, propertyKey: string, descriptor: PropertyDescriptor) {
        descriptor.enumerable = value;
    };
}
class Greeter {
    greeting: string;
    constructor(message: string) {
        this.greeting = message;
    }

    @enumerable(false)
    greet() {
        return "Hello, " + this.greeting;
    }
}